import React from 'react';
import ReactDOM from 'react-dom';
import { HotTable } from '@handsontable/react';
import Handsontable from 'handsontable';
var myData = [
    { id: 1, name: 'John', age: 24, __children: [
      { id: 11, name: 'Mary', age: 23 },
      { id: 12, name: 'Bob', age: 25 }
    ], __level: 0 },
    { id: 2, name: 'Tom', age: 26, __children: [
      { id: 21, name: 'Kate', age: 22 },
      { id: 22, name: 'Mike', age: 27 }
    ], __level: 0 },
    { id: 3, name: 'Sue', age: 29, __level: 0 }
  ];
export default class App extends React.Component {
  constructor(props) {
    super(props);
    window.$appRoot = this
    this.handsontableData = Handsontable.helper.createSpreadsheetData(10, 2000);
    this.hot = React.createRef()
    this.hotSettings = {
      data: myData,
      nestedRows: true,// 开启嵌套行
      cells(row, col, prop) {
          
      },
      beforeChange: function(changes) {

      }    
    };
  }
  afterRenderer = (TD, row, col, prop, value, cellProperties) => {

  }

  componentDidMount() {
  }
  render() {

    return (
        <HotTable
          id="hot"
          ref={this.hot}
          settings={this.hotSettings}
        />
/*       <div style={{ width: '1900px', height: '1400px', overflow: 'auto' }}>
      </div> */
    );
  }
}

